<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        var date = new Date();
        //设置年
        date.setFullYear(2000)
        console.log(date);
        //设置月
        date.setMonth(1)
        console.log(date);
        //设置日
        date.setDate(25)
        console.log(date);
        //设置时
        date.setHours(22)
        console.log(date);
        //设置分
        date.setMinutes(34)
        console.log(date);
        //设置秒
        date.setSeconds(59)
        console.log(date);
    </script>
</body>
</html>